import model.ActionType;
import model.Game;
import model.Hockeyist;
import model.Move;
import model.World;

/**
 *
 * @author Constantine Tretyak
 */
public class DeadZoneAttack extends AbstractAttack {

    public DeadZoneAttack(Hockeyist self, World world, Game game, Move move, long puckOwner, long first) {
        super(self, world, game, move, puckOwner, first);
    }


    @Override
    protected void firstTeammate() {
        defendNet(false);
    }

    @Override
    protected void puckOwner() {
        if (AGGRESSIVE_ATTACK_OPP_TICKS > 0) {
            move.setAction(ActionType.STRIKE);
            return;
        }
        if (getOppsBack(self, game.getStickLength()).isEmpty()) {
            pass(getUnitById(first));
            return;
        }
        move.setTurn(self.getAngleTo(getNet(true)));
        move.setSpeedUp(-0.1d);
        move.setAction(ActionType.STRIKE);
    }

}
